﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SpiceNet.Parameters;

namespace SpiceNet.Circuits
{
    /// <summary>
    /// Definition of a circuit node
    /// </summary>
    public class CircuitNode
    {
        /// <summary>
        /// Gets or sets the name of the node
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Number of the node
        /// </summary>
        public int Number { get; protected set; }

        /// <summary>
        /// Gets or sets the nodeset value
        /// </summary>
        public Parameter<double> Nodeset { get; private set; }

        /// <summary>
        /// Gets or sets the initial condition
        /// </summary>
        public Parameter<double> IC { get; private set; }

        /// <summary>
        /// Gets or sets the type
        /// </summary>
        public NodeType Type { get; private set; }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="type"></param>
        public CircuitNode(NodeType type, int number = 0)
        {
            Nodeset = new Parameter<double>();
            IC = new Parameter<double>();
            Type = type;
            Number = number;
        }
    }

    /// <summary>
    /// An enumeration of node types
    /// </summary>
    public enum NodeType { Voltage = 0x03, Current = 0x04 };
}
